package com.weds.data_sync.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * <p>
 * 方案执行记录表
 * </p>
 *
 * @author lhw
 * @since 2024-01-11
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("public.data_sync_plan_record")
@Schema(name = "DataSyncPlanRecordDO", description = "方案执行记录表")
public class DataSyncPlanRecordDO {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "方案id")
    @TableField("plan_id")
    private Long planId;

    @Schema(description = "最近执行时间")
    @TableField("exec_time")
    private LocalDateTime execTime;

    @Schema(description = "方案session id")
    @TableField("plan_session_id")
    private String planSessionId;

    @Schema(description = "方案执行session数据")
    @TableField("plan_data")
    private String planData;

    @Schema(description = "是否执行成功: 1 成功 0 失败 2 超时")
    @TableField("is_success")
    private Integer isSuccess;

    @Schema(description = "重试次数")
    @TableField("retry_count")
    private Integer retryCount;

    @Schema(description = "启用状态")
    @TableField("use_status_id")
    private Integer useStatusId;

    @Schema(description = "删除状态")
    @TableField("is_delete")
    private Integer isDelete;

    @Schema(description = "备注")
    @TableField("remark")
    private String remark;

    @Schema(description = "创建时间")
    @TableField("ct_date")
    private LocalDateTime ctDate;

    @Schema(description = "修改时间")
    @TableField("lt_date")
    private LocalDateTime ltDate;

    @Schema(description = "创建用户id")
    @TableField("ct_user_id")
    private Integer ctUserId;

    @Schema(description = "修改用户id")
    @TableField("lt_user_id")
    private Integer ltUserId;
}
